const spin = {
  state: {
    loading: false
  },
  mutations: {
    UPDATE_LOADING: (state, flag) => {
      state.loading = flag
    }
  },
  actions: {
    hideLoading: ({ commit }) => {
      commit('UPDATE_LOADING', false)
    },
    showLoading: ({ commit }) => {
      commit('UPDATE_LOADING', true)
    },
  }
}

export default spin
